//
//  UIViewController+ContentArea.m
//  NekaPrice
//
//  Created by yu on 2018/6/27.
//  Copyright © 2018年 ma c. All rights reserved.
//

#import "UIViewController+ContentArea.h"
#define KIsiPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
@implementation UIViewController (ContentArea)

- (CGFloat)bottom {
    
    CGFloat bottom = 0;
    if (KIsiPhoneX) {
        bottom = 34;
    }
    
    if (self.tabBarController && self.tabBarController.tabBar.hidden == NO) {
        bottom += 49;
    }
    
    return bottom;
}

- (CGFloat)top {
    CGFloat top = 20;
    if (KIsiPhoneX) {
        top = 44;
    }
    if (self.navigationController && self.navigationController.navigationBar.hidden == NO) {
        top += 44;
    }
    return top;
}




@end
